package com.shhm.business.controller.business;

import com.shhm.business.dto.request.HistoryOrdSearchReq;
import com.shhm.business.service.business.BusiOdrHistoryService;
import com.shhm.common.dto.response.AjaxResult;
import com.shhm.common.dto.response.AjaxResultPlus;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/18 下午2:34
 */
@RestController
public class BusiOdrHistoryController {
    @Resource
    private BusiOdrHistoryService busiOdrHistoryService;

    @PostMapping("/business/order/history/search")
    public AjaxResult searchOrderHistory(
            @RequestBody HistoryOrdSearchReq req,
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "10")Integer pageSize) {
        return busiOdrHistoryService.searchOrderHistory(req, pageNum, pageSize);
    }

    @DeleteMapping("/business/order/history/delete/{orderNum}")
    public AjaxResultPlus deleteOrderHistory(@PathVariable String orderNum) {
        return busiOdrHistoryService.deleteOrderHistory(orderNum);
    }
}
